home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / AIFF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  6.3 KB  |  260 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Contains:    Definition of AIFF file format components.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1989-1995, 1997-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __AIFF__
  19. #define __AIFF__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24.  
  25.  
  26.  
  27. #if PRAGMA_ONCE
  28. #pragma once
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_STRUCT_ALIGN
  40.     #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42.     #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44.     #pragma pack(2)
  45. #endif
  46.  
  47.  
  48. enum {
  49.     AIFFID                        = FOUR_CHAR_CODE('AIFF'),
  50.     AIFCID                        = FOUR_CHAR_CODE('AIFC'),
  51.     FormatVersionID                = FOUR_CHAR_CODE('FVER'),
  52.     CommonID                    = FOUR_CHAR_CODE('COMM'),
  53.     FORMID                        = FOUR_CHAR_CODE('FORM'),
  54.     SoundDataID                    = FOUR_CHAR_CODE('SSND'),
  55.     MarkerID                    = FOUR_CHAR_CODE('MARK'),
  56.     InstrumentID                = FOUR_CHAR_CODE('INST'),
  57.     MIDIDataID                    = FOUR_CHAR_CODE('MIDI'),
  58.     AudioRecordingID            = FOUR_CHAR_CODE('AESD'),
  59.     ApplicationSpecificID        = FOUR_CHAR_CODE('APPL'),
  60.     CommentID                    = FOUR_CHAR_CODE('COMT'),
  61.     NameID                        = FOUR_CHAR_CODE('NAME'),
  62.     AuthorID                    = FOUR_CHAR_CODE('AUTH'),
  63.     CopyrightID                    = FOUR_CHAR_CODE('(c) '),
  64.     AnnotationID                = FOUR_CHAR_CODE('ANNO')
  65. };
  66.  
  67.  
  68. enum {
  69.     NoLooping                    = 0,
  70.     ForwardLooping                = 1,
  71.     ForwardBackwardLooping        = 2,                            /* AIFF-C Versions */
  72.     AIFCVersion1                = (long)0xA2805140
  73. };
  74.  
  75.  
  76.  
  77. /* Compression Names */
  78. #define NoneName "\pnot compressed"
  79. #define ACE2to1Name "\pACE 2-to-1"
  80. #define ACE8to3Name "\pACE 8-to-3"
  81. #define MACE3to1Name "\pMACE 3-to-1"
  82. #define MACE6to1Name "\pMACE 6-to-1"
  83.  
  84.  
  85. enum {
  86.                                                                 /* Compression Types */
  87.     NoneType                    = FOUR_CHAR_CODE('NONE'),
  88.     ACE2Type                    = FOUR_CHAR_CODE('ACE2'),
  89.     ACE8Type                    = FOUR_CHAR_CODE('ACE8'),
  90.     MACE3Type                    = FOUR_CHAR_CODE('MAC3'),
  91.     MACE6Type                    = FOUR_CHAR_CODE('MAC6')
  92. };
  93.  
  94. typedef unsigned long                     ID;
  95. typedef short                             MarkerIdType;
  96.  
  97. struct ChunkHeader {
  98.     ID                                 ckID;
  99.     long                             ckSize;
  100. };
  101. typedef struct ChunkHeader                ChunkHeader;
  102.  
  103. struct ContainerChunk {
  104.     ID                                 ckID;
  105.     long                             ckSize;
  106.     ID                                 formType;
  107. };
  108. typedef struct ContainerChunk            ContainerChunk;
  109.  
  110. struct FormatVersionChunk {
  111.     ID                                 ckID;
  112.     long                             ckSize;
  113.     unsigned long                     timestamp;
  114. };
  115. typedef struct FormatVersionChunk        FormatVersionChunk;
  116. typedef FormatVersionChunk *            FormatVersionChunkPtr;
  117.  
  118. struct CommonChunk {
  119.     ID                                 ckID;
  120.     long                             ckSize;
  121.     short                             numChannels;
  122.     unsigned long                     numSampleFrames;
  123.     short                             sampleSize;
  124.     extended80                         sampleRate;
  125. };
  126. typedef struct CommonChunk                CommonChunk;
  127. typedef CommonChunk *                    CommonChunkPtr;
  128.  
  129. struct ExtCommonChunk {
  130.     ID                                 ckID;
  131.     long                             ckSize;
  132.     short                             numChannels;
  133.     unsigned long                     numSampleFrames;
  134.     short                             sampleSize;
  135.     extended80                         sampleRate;
  136.     ID                                 compressionType;
  137.     char                             compressionName[1];            /* variable length array, Pascal string */
  138. };
  139. typedef struct ExtCommonChunk            ExtCommonChunk;
  140. typedef ExtCommonChunk *                ExtCommonChunkPtr;
  141.  
  142. struct SoundDataChunk {
  143.     ID                                 ckID;
  144.     long                             ckSize;
  145.     unsigned long                     offset;
  146.     unsigned long                     blockSize;
  147. };
  148. typedef struct SoundDataChunk            SoundDataChunk;
  149. typedef SoundDataChunk *                SoundDataChunkPtr;
  150.  
  151. struct Marker {
  152.     MarkerIdType                     id;
  153.     unsigned long                     position;
  154.     Str255                             markerName;
  155. };
  156. typedef struct Marker                    Marker;
  157.  
  158. struct MarkerChunk {
  159.     ID                                 ckID;
  160.     long                             ckSize;
  161.     unsigned short                     numMarkers;
  162.     Marker                             Markers[1];                    /* variable length array */
  163. };
  164. typedef struct MarkerChunk                MarkerChunk;
  165. typedef MarkerChunk *                    MarkerChunkPtr;
  166.  
  167. struct AIFFLoop {
  168.     short                             playMode;
  169.     MarkerIdType                     beginLoop;
  170.     MarkerIdType                     endLoop;
  171. };
  172. typedef struct AIFFLoop                    AIFFLoop;
  173.  
  174. struct InstrumentChunk {
  175.     ID                                 ckID;
  176.     long                             ckSize;
  177.     UInt8                             baseFrequency;
  178.     UInt8                             detune;
  179.     UInt8                             lowFrequency;
  180.     UInt8                             highFrequency;
  181.     UInt8                             lowVelocity;
  182.     UInt8                             highVelocity;
  183.     short                             gain;
  184.     AIFFLoop                         sustainLoop;
  185.     AIFFLoop                         releaseLoop;
  186. };
  187. typedef struct InstrumentChunk            InstrumentChunk;
  188. typedef InstrumentChunk *                InstrumentChunkPtr;
  189.  
  190. struct MIDIDataChunk {
  191.     ID                                 ckID;
  192.     long                             ckSize;
  193.     UInt8                             MIDIdata[1];                /* variable length array */
  194. };
  195. typedef struct MIDIDataChunk            MIDIDataChunk;
  196. typedef MIDIDataChunk *                    MIDIDataChunkPtr;
  197.  
  198. struct AudioRecordingChunk {
  199.     ID                                 ckID;
  200.     long                             ckSize;
  201.     UInt8                             AESChannelStatus[24];
  202. };
  203. typedef struct AudioRecordingChunk        AudioRecordingChunk;
  204. typedef AudioRecordingChunk *            AudioRecordingChunkPtr;
  205.  
  206. struct ApplicationSpecificChunk {
  207.     ID                                 ckID;
  208.     long                             ckSize;
  209.     OSType                             applicationSignature;
  210.     UInt8                             data[1];                    /* variable length array */
  211. };
  212. typedef struct ApplicationSpecificChunk    ApplicationSpecificChunk;
  213. typedef ApplicationSpecificChunk *        ApplicationSpecificChunkPtr;
  214.  
  215. struct Comment {
  216.     unsigned long                     timeStamp;
  217.     MarkerIdType                     marker;
  218.     unsigned short                     count;
  219.     char                             text[1];                    /* variable length array, Pascal string */
  220. };
  221. typedef struct Comment                    Comment;
  222.  
  223. struct CommentsChunk {
  224.     ID                                 ckID;
  225.     long                             ckSize;
  226.     unsigned short                     numComments;
  227.     Comment                         comments[1];                /* variable length array */
  228. };
  229. typedef struct CommentsChunk            CommentsChunk;
  230. typedef CommentsChunk *                    CommentsChunkPtr;
  231.  
  232. struct TextChunk {
  233.     ID                                 ckID;
  234.     long                             ckSize;
  235.     char                             text[1];                    /* variable length array, Pascal string */
  236. };
  237. typedef struct TextChunk                TextChunk;
  238. typedef TextChunk *                        TextChunkPtr;
  239.  
  240. #if PRAGMA_STRUCT_ALIGN
  241.     #pragma options align=reset
  242. #elif PRAGMA_STRUCT_PACKPUSH
  243.     #pragma pack(pop)
  244. #elif PRAGMA_STRUCT_PACK
  245.     #pragma pack()
  246. #endif
  247.  
  248. #ifdef PRAGMA_IMPORT_OFF
  249. #pragma import off
  250. #elif PRAGMA_IMPORT
  251. #pragma import reset
  252. #endif
  253.  
  254. #ifdef __cplusplus
  255. }
  256. #endif
  257.  
  258. #endif /* __AIFF__ */
  259.  
  260.